package com.plian.system.entity.im;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @description: 市属国企基金项目情况
 * @author: gangan
 * @create: 2020-04-27 11:06
 */
@Data
@TableName("im_fund_project")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "FundProject对象", description = "基金项目执行明细")
public class FundProject extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long baseInvestmentExecutionId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "基金项目信息id")
    private Long fundProjectInfoId;

    /**
     * 之前基金执行跟项目投资计划执行一起的，现在单独关联基金执行计划
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "之前基金执行跟项目投资计划执行一起的，现在单独关联基金执行计划")
    private Long fundProjectExecutionId;

    /**
     * 所属集团
     */
    @ApiModelProperty(value = "所属集团")
    private String companyId;

    /**
     * 基金标准全称
     */
    @ApiModelProperty(value = "基金标准全称", required = true)
    private String fundName;

    /**
     * 本集团投资主体
     */
    @ApiModelProperty(value = "本集团投资主体")
    private String investmentSubject;

    /**
     * 类别
     */
    @ApiModelProperty(value = "类别")
    private String fundCategory;

    /**
     * 成立日期
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @TableField(value = "start_time",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "成立日期", required = true)
    private Date startTime;

    /**
     * 到期日期
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @TableField(value = "end_time",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "到期日期", required = true)
    private Date endTime;

    /**
     * GP(含出资额)
     */
    @TableField(value = "gp",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "GP(含出资额)")
    private BigDecimal gp;

    /**
     * LP(含出资额)
     */
    @TableField(value = "lp",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "LP(含出资额)")
    private BigDecimal lp;

    /**
     * 基金规模
     */
    @TableField(value = "fund_scale",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "基金规模", required = true)
    private BigDecimal fundScale;

    /**
     * 已实缴出资
     */
    @TableField(value = "contributed_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "已实缴出资", required = true)
    private BigDecimal contributedCapital;

    /**
     * 本公司认缴金额
     */
    @TableField(value = "company_contributed_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "本公司认缴金额", required = true)
    private BigDecimal companyContributedCapital;

    /**
     * 本公司已出资
     */
    @TableField(value = "has_contributed_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "本公司已出资", required = true)
    private BigDecimal hasContributedCapital;

    @TableField(exist = false)
    private List<FundInvestedProject> fundInvestedProjects;


    /**
     * GP(含出资额) 明细
     */
    @ApiModelProperty(value = "GP(含出资额) 明细", required = true)
    private String gpDetail;

    /**
     * LP(含出资额) 明细
     */
    @ApiModelProperty(value = "LP(含出资额) 明细", required = true)
    private String lpDetail;

    /**
     * 排序号
     */
    @ApiModelProperty(value = "排序号")
    private String orderNumber;

    /**
     * 管理方式
     */
    @ApiModelProperty(value = "管理方式", required = true)
    private String manageMode;

    /**
     * 基金类型
     */
    @ApiModelProperty(value = "基金类型", required = true)
    private String fundType;

    /**
     * 组织形式
     */
    @ApiModelProperty(value = "组织形式", required = true)
    private String organizationForm;

    /**
     * 基金状态
     */
    @ApiModelProperty(value = "基金状态", required = true)
    private String fundStatus;

    /**
     *内部收益率
     */
    @TableField(value = "internal_yield_rate",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "内部收益率", required = true)
    private BigDecimal internalYieldRate;

    /**
     * 管理人类型
     */
    @ApiModelProperty(value = "管理人类型", required = true)
    private String managerType;

    /**
     * 项目情况
     */
    @ApiModelProperty(value = "项目情况")
    private String projectSituation;

    /**
     * 认缴出资额
     */
    @TableField(value = "subscribed_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "认缴出资额", required = true)
    private BigDecimal subscribedCapital;

    /**
     * 本年度已实缴出资
     */
    @TableField(value = "year_contributed_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "本年度已实缴出资", required = true)
    private BigDecimal yearContributedCapital;

    /**
     * 本公司本年度已实缴出资
     */
    @TableField(value = "company_year_contributed_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "本公司本年度已实缴出资", required = true)
    private BigDecimal companyYearContributedCapital;


    /**
     * 集团标准全称
     */
    @ApiModelProperty(value = "集团标准全称", required = true)
    private String affiliatedOrgFullName;

    /**
     * 基金性质
     */
    @ApiModelProperty(value = "基金性质", required = true)
    private String fundNature;

    @TableField(exist = false)
    @ApiModelProperty(value = "gp明细")
    private List<FundProjectAmountDetail> gpDetailList;

    @TableField(exist = false)
    @ApiModelProperty(value = "lp明细")
    private List<FundProjectAmountDetail> lpDetailList;

}
